import http from '/@/serve/index';
import { formatQuery } from '/@/libs/utils/format';

const BASE_URL: string = '/evo/tasks';

export const getBarcodes = (taskId: string, page?: number, pageSize?: number) =>
  http.get(`${BASE_URL}/${taskId}/barcodes?${formatQuery({ page, pageSize })}`);

export const getBarcodeDetail = (barcodeId: string) => http.get(`/evo/barcodes?/${barcodeId}`);

export const getBarcodeDetailByTask = (taskId: string, barcodeId: string) =>
  http.get(`${BASE_URL}/${taskId}/barcodes/${barcodeId}`);
